<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/8/29 0029
  Time: 10:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        //使用XMLHttpRequest发送请求
        //1.创建XMLHtppRequest对象
        var xhr = new XMLHttpRequest();
        //2.注册onreadystatechange
        xhr.onreadystatechange = function () {
           // alert(xhr.readyState)
            if (xhr.readyState==4){
                alert(xhr.status);
            }
        }
        //3.准备带给服务器端的数据
        //4.发送请求
        xhr.open("GET","/ajax_json/ajax1Servlet?id=100",true);
        xhr.send(null);
    </script>
</head>
<body>

</body>
</html>
